package com.timesheet.server.core.models;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
public class Project implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "PROJ_ID")
	private String projectId;
	@Column(name = "proj_name")
	private String projectName;

	@ManyToMany(cascade = CascadeType.ALL)
	@JoinTable(name = "EMP_PROJECT_ASSIGNMENT", joinColumns = { @JoinColumn(name = "PROJ_ID", referencedColumnName = "PROJ_ID") }, inverseJoinColumns = { @JoinColumn(name = "EMP_ID", referencedColumnName = "EMP_ID") })
	private Collection<Employee> employees;

	@OneToMany(cascade = CascadeType.ALL)
	@JoinTable(name = "TASK_PROJECT", joinColumns = { @JoinColumn(name = "PROJ_ID", referencedColumnName = "PROJ_ID") }, inverseJoinColumns = { @JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID") })
	private Collection<Task> tasks;

	

	public Collection<Task> getTasks() {
		return tasks;
	}

	public void setTasks(Collection<Task> tasks) {
		this.tasks = tasks;
	}

	public Collection<Employee> getEmployees() {
		return employees;
	}

	public void setEmployees(Collection<Employee> employees) {
		this.employees = employees;
	}

	public String getProjectId() {
		return projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectId(String projectId) {
		this.projectId = projectId;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	

}
